//
//  ALPDateBaseManager.h
//  AlpFM
//
//  Created by KING on 16/1/28.
//  Copyright © 2016年 Alp. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ALPAlbumModel.h"
#import "ALPListerModel.h"
#import "ALPPlayModel.h"
#import "ALPSingleModel.h"
#import "ALPHistoryModel.h"
@interface ALPDateBaseManager : NSObject
#pragma mark - 创建数据库
+(instancetype)shareFMDB;

#pragma mark - 打开数据库
- (void)openDB;

#pragma mark - 创建收藏专辑的表
- (void)createAlbumsTable;

#pragma mark - 插入专辑对象
- (void)insertAlbum:(ALPAlbumModel *)album andUserName:(NSString *)name;

#pragma mark - 删除
- (void)deleteAlbumWithTitle:(NSString *)title;

#pragma mark - 查询
- (NSMutableArray *)selectALbumDataWhereUserName:(NSString *)userName;



#pragma mark - 创建播放历史的表
- (void)createHistoryTable;

#pragma mark - 插入播放历史记录
- (void)insertHistory:(ALPSingleModel *)playerModel andLastTime:(NSString *)time andSong_ID:(NSString *)song_ID;
#pragma mark - 查询历史记录
- (NSMutableArray *)seleteHistory;

#pragma mark - 清空
- (void)deleteHistory;

#pragma mark - 根据指定ID删除
- (void)deleteHistoryWithSong_ID:(NSString *)song_id;

#pragma mark - 更新
- (void)upDataHistoryLastTime:(NSString *)time WithSongID:(NSString *)song_ID;
@end